<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

get_header(); ?>
<?php 
$args = array(
	'authors'      => '',
	'child_of'     => $post ->ID,
	'date_format'  => get_option('date_format'),
	'depth'        => 0,
	'echo'         => 1,
	'exclude'      => '',
	'include'      => '',
	'link_after'   => '',
	'link_before'  => '',
	'post_type'    => 'page',
	'post_status'  => 'publish',
	'show_date'    => '',
	'sort_column'  => 'menu_order, post_title',
	'title_li'     => __('Pages'), 
	'walker'       => '',
	'order'        => 'ASC',
	'orderby'      => 'title',
	'nopaging'     => true,
	'meta_query'   => array(
		array(
			'key'       => 'imagem',
			'value'     => '',
			'compare'   => '!=',
		),
	),
);
query_posts($args);
?> 
		<div id="primary">
			<div class="container" id="marca" role="main">
				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
					<h1 class="entry-title">MARCAS</h1>
					<div class="entry-content">
				<?php while ( have_posts() ) : the_post(); ?>
						<!-- <header class="entry-header">
							<h1 class="entry-title"><?php the_title(); ?></h1>
						</header>.entry-header -->
<?php 						$array = get_post_custom_values('imagem'); 
							$imagem = $array[0];
?>
							<div class="fl">
								<a href="<?=the_permalink();?>"><img src="<?=get_bloginfo('wpurl');?>/wp-content/files_mf/<?=$imagem;?>" /></a>
							</div>
						
				<?php endwhile; // end of the loop. ?>
					</div><!-- .entry-content -->
				</article><!-- #post-<?php the_ID(); ?> -->
				<div class="clear"></div>
			</div><!-- #content -->
		</div><!-- #primary -->
<?php get_sidebar('page'); ?>
<?php get_footer(); ?>